import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    { path: '/login', component: () => import('@/views/login/LoginPage.vue') },
    { 
      path: '/', 
      component: () => import('@/views/layout/LayoutContainer.vue'),
      redirect: '/layout',
      children: [
        { 
          path: '/layout', 
          component: () => import('@/views/layout/LayoutPage.vue')
        },
        { 
          path: '/technology',
          component: () => import('@/views/layout/TechnologyPage.vue'),
          redirect: '/technology/category?key=前端',
          children: [
            { path: '/technology/category', component: () => import('@/views/layout/TechnologyItem.vue')}
          ]
        },
        { path: 'publish', component: () => import('@/views/layout/PublishPage.vue') },
        { path: '/users', component: () => import('@/views/layout/AllUserPage.vue') },
        { path: '/article', component: () => import('@/views/layout/components/ArticleDetail.vue') }
      ]
    }
  ]
})

export default router
